package com.beijiteshop.shop.ui.login.repo

import com.beijiteshop.libcommon.login.LoginInfo
import com.beijiteshop.libcommon.login.UserInfo
import com.beijiteshop.libcommon.network.ext.BaseRsp
import com.beijiteshop.libcommon.network.ext.ResultRsp
import com.beijiteshop.shop.model.api.request.LoginRequest
import com.beijiteshop.shop.model.api.response.UserBindingInfoBean
import retrofit2.Call
import retrofit2.http.*

/**
 * @Author LiaoZhongKai
 * @Date 2021/3/12 20:08
 * @Description
 */
interface UserService {

    @GET("/api/login/getcode")
    fun getSmsCode(@Query("phone")phone: String): Call<ResultRsp>

    @POST("/api/login/loginin")
    fun login(@Body request: LoginRequest): Call<ResultRsp>

    @GET("/api/login/authorization")
    fun wxLogin(@Query("code") code: String): Call<BaseRsp<String>>

    @GET("/api/user/getuserinfo")
    fun getUserInfo(): Call<BaseRsp<UserInfo>>

    @GET("/api/user/getbanginfo")
    fun getBindingInfo(): Call<BaseRsp<UserBindingInfoBean?>>

    @POST("/api/user/bangwx")
    fun bindWeChat(@Query("code")code: String): Call<ResultRsp>

    @POST("/api/user/bangphone")
    fun bindPhone(@Body request: LoginRequest) : Call<ResultRsp>
}